<template>
	<view class="back_img" id="back_img" :style="{ backgroundImage: 'url(' + backMsg.invitationImage + ')' }">
		<!-- <text class="bwTxt font30">本无签</text> -->
		
		<view class="msg_box1" v-if="backMsg.invitationStyle == '样式1'">
			<view class="title font36">{{ backMsg.themeName }}</view>
			<view class="time_box font24">
				<view class="" style="font-size: 29rpx;">TIME/时间</view>
				<view class="font28">{{ formatDate(backMsg.gmtStart) }} - {{ formatDate(backMsg.gmtEnd) }}</view>
			</view>
			<view class="add_box font24">
				<view class="" style="font-size: 29rpx;">ADD/地址</view>
				<view class="font28">{{ backMsg.address }}</view>
			</view>
		</view>
		<view class="title2_box" v-if="backMsg.invitationStyle == '样式2'">
			<view class="title2">{{ backMsg.themeName }}</view>
		</view>
		<view class="msg_box2" v-if="backMsg.invitationStyle == '样式2'">
			<view class="time2 font22">时间</view>
			<view class="font24">{{ formatDate(backMsg.gmtStart) }} - {{ formatDate(backMsg.gmtEnd) }}</view>
			<view class="add2 font22">地点</view>
			<view class="font28">{{ backMsg.address }}</view>
		</view>
		<view class="msg_box3" v-else-if="backMsg.invitationStyle == '样式3'">
			<view class="title">
				<img class="title_img" src="https://ebc-prod.cdn.benwunet.com/uni-static/img3.3.0/mine/title.png" alt="" />
				<view class="title_txt font36">{{ backMsg.themeName }}</view>
			</view>
			<view class="time3">
				<view class="time_title backGradient font24">时间/TIME</view>
				<view class="time_value backGradient font28">{{ formatDate(backMsg.gmtStart) }} - {{ formatDate(backMsg.gmtEnd) }}</view>
			</view>
			<view class="add3">
				<view class="add_title backGradient font24">地点/PLACE</view>
				<view class="add_value backGradient font28">{{ backMsg.address }}</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	props: {
		backMsg: {
			type: Object,
			default: () => {}
		}
	},
	data() {
		return {};
	},
	onLoad() {},
	methods: {
		// 格式化时间
		formatDate(time) {
			let date = time.split(' ')[0];
			return date.replaceAll('-', '.');
		}
	}
};
</script>

<style scoped lang="scss">
.back_img {
	height: 100vh;
	background-size: 100% 100%;
	position: relative;
	.bwTxt{
		position: absolute;
		top: 200rpx;
		left: 30rpx;
		font-weight: bold;
	}
	.msg_box1 {
		position: absolute;
		left: 80rpx;
		bottom: 200rpx;
		.title {
			line-height: 80rpx;
			font-size: 48rpx;
			margin-bottom: 57rpx;
		}
		.time_box {
			> view {
				margin-bottom: 23rpx;
			}
		}
		.add_box {
			margin-top: 40rpx;
			> view {
				margin-bottom: 23rpx;
			}
		}
	}
	.title2_box {
		position: absolute;
		top: 330rpx;
		left: 50rpx;
		.title2 {
			font-size: 52rpx;
			font-weight: bold;
			overflow: hidden;
			line-height: 68rpx;
			-webkit-line-clamp: 2;
			text-overflow: ellipsis;
			display: -webkit-box;
			-webkit-box-orient: vertical;
		}
	}
	.msg_box2 {
		position: absolute;
		bottom: 120rpx;
		right: 40rpx;
		.time2 {
			color: #9537cf;
		}
		.add2 {
			color: #9537cf;
		}
		> view {
			margin-bottom: 20rpx;
			text-align: right;
		}
	}
	.msg_box3 {
		position: absolute;
		transform: translate(-50%, -50%);
		top: 63%;
		left: 50%;
		width: 530rpx;
		text-align: center;
		.title {
			position: relative;
			.title_img {
				width: 100%;
			}
			.title_txt {
				position: absolute;

				color: #000;
				font-weight: bold;
				transform: translate(-50%, -50%);
				top: 45%;
				left: 50%;
				overflow: hidden;
				width: 240px;
				white-space: nowrap;
				text-overflow: ellipsis;
			}
		}
		.backGradient {
			background: linear-gradient(0deg, #1150c3 0%, #2467ff 100%);
			-webkit-background-clip: text;
			-webkit-text-fill-color: transparent;
		}
		.time3 {
			margin-top: 50rpx;
			.time_title {
				margin-bottom: 20rpx;
			}
			.time_value {
				font-weight: 500;
			}
		}
		.add3 {
			margin-top: 40rpx;
			.add_title {
				margin-bottom: 20rpx;
			}
			.add_value {
				line-height: 34rpx;
				font-weight: 500;
			}
		}
	}
}
</style>
